package com.sjtu.feign;

import com.sjtu.web.Result;
import com.sjtu.web.form.UserAccountForm;
import com.sjtu.web.form.UserAccountResetPwdForm;
import com.sjtu.web.search.UserAccountSearch;
import com.sjtu.web.vo.UserAccountVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * nerine
 * 2/2/2020
 */
@FeignClient(contextId = "user-account", name = "SERVER-CORE")
public interface UserAccountFeign {
    String PREFIX = "/core/user-account";

    @PostMapping(PREFIX + "/save")
    Result<?> save(@RequestBody UserAccountForm form);
    @GetMapping(value = PREFIX + "/find-by-user-id")
    Result<UserAccountVo> findByUserId(@RequestParam("userId") String userId);
    @PostMapping(PREFIX + "/list")
    Result<?> list(@RequestBody UserAccountSearch search);
    @PostMapping(PREFIX + "/reset-pwd")
    Result<?> resetPwd(@RequestBody UserAccountResetPwdForm form);
    @GetMapping(PREFIX + "/detail/{id}")
    Result<?> detail(@PathVariable String id);
}
